﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using System.Web.Mvc;
namespace VehicleManagement.Models
{
        //--------车辆保险表---------
        //CREATE	TABLE CarInsure
        //(
        //CarInsureID int  IDENTITY(1,1) primary key,
        //CarID int,
        //Insure_Com nvarchar(30),
        //Insure_type nvarchar(30),
        //Insure_Date Datetime,
        //InvoiceNo  nvarchar(18) unique,
        //Beg_Date Datetime,
        //End_Date Datetime,
        //Insure_Agent nvarchar(18),
        //Approval bit,
        //Remark  char(100),
        //foreign key (CarID) references CarInfo(CarID)
        //)

    /// <summary>
    /// 车辆保险类
    /// </summary>
    public class CarInsure
    {
        public int CarInsureID { get; set; }
        public int CarID { get; set; }

        [DisplayName("保险公司")]
        [Required(ErrorMessage = "保险公司不能为空")]
        [StringLength(30, ErrorMessage = "保险公司长度不能超过30位")]
        public string InsureCom { get; set; }

        [DisplayName("车牌号码")]
        [Required(ErrorMessage = "车牌号不能为空")]
        [StringLength(18, ErrorMessage = "车牌号长度不能超过18位")]
        public virtual string CarNumber { get; set; }

        [DisplayName("保险类型")]
        [Required(ErrorMessage = "保险类型不能为空")]
        [StringLength(30, ErrorMessage = "保险类型长度不能超过30位")]
        public string Insuretype { get; set; }

        [DisplayName("日期")]
        [Required(ErrorMessage = "日期不能为空")]
        [DataType(DataType.DateTime)]
        
        public DateTime InsureDate { get; set; }

        [DisplayName("保单号")]
        [Required(ErrorMessage = "保单号不能为空")]
        [StringLength(18, ErrorMessage = "保单号长度不能超过18位")]
        public string InvoiceNo { get; set; }

        [DisplayName("开始日期")]
        [Required(ErrorMessage = "开始日期不能为空")]
        [DataType(DataType.DateTime)]
        public DateTime BegDate { get; set; }

        [DisplayName("结束日期")]
        [Required(ErrorMessage = "结束日期不能为空")]
        [DataType(DataType.DateTime)]
        public DateTime EndDate { get; set; }

        [DisplayName("经办人")]
        [Required(ErrorMessage = "经办人不能为空")]
        [StringLength(18, ErrorMessage = "经办人长度不能超过18位")]
        public string InsureAgent { get; set; }

        [DisplayName("有无审批")]
        [Required(ErrorMessage = "有无审批不能为空")]
        public Boolean Approval { get; set; }

        [DisplayName("说明")]
        public string Remark { get; set; }
    }
}